<!--{include(file='head.html')}-->
<div id="wrap">
	<!--{include('left.html')}-->
	<div id="maincont">
		<b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>
		<form action="<!--{url('admin','basicset','im')}-->" method="post" name="submitform" id="submitform">
		<div id="main_c">
			<ul class="bk">
				<li>
					<label>客服状态：</label>
					<p>
						<input type="radio" value="open"	name="imstatus" <!--{if $imset.imstatus != 'close'}-->checked<!--{/if}-->/> 开启
						<input type="radio" value="close"	name="imstatus" <!--{if $imset.imstatus == 'close'}-->checked<!--{/if}-->/> 关闭
					</p>
				</li>
				<li>
					<label>标题文字：</label>
					<p>
						<textarea name="imtext" class="text_tx"><!--{def($imset.imtext)}--></textarea>
					</p>
				</li>
			</ul>

			<table class="tableStyle" border="0" cellspacing="0" cellpadding="0">
				<thead>
					<tr>
						<td colspan="5">
							<div class="bt_bk" style="margin:5px auto;">
								<a href="javascript:void(0);" onclick="jsadd('qq');return false;">添加QQ号</a>
								<a href="javascript:void(0);" onclick="jsadd('ww');return false;">添加旺旺号</a>
							</div>
						</td>
					</tr>
				</thead>
				<tbody id="listtbody">
					<!--{foreach $imusers user}-->
					<tr align="center">
						<td>
							<!--{if $user.imtype == 'qq'}-->
								QQ
							<!--{elseif $user.imtype == "ww"}-->
								阿里旺旺
							<!--{/if}-->
						</td>
						<td>
							<input type="text" value="<!--{$user.imid}-->" name="imid[]" class="short-input"/>
						</td>
						<td>昵称</td>
						<td>
							<input type="text" value="<!--{$user.imnick}-->" name="imnick[]" class="short-input"/>
						</td>
						<td><a href="javascript:void(0);" onclick="$.oper.del(this);return false;" class="del"></a></td>
						<input type="hidden" value="<!--{$user.imtype}-->" name="imtype[]"/>
					</tr>
					<!--{/foreach}-->
				</tbody>
			</table>

			<div class="bt_bk2">
				<a href="javascript:void(0);" class="btn" onclick="$.oper.submit();return false;"><span>保存</span></a>
			</div>
		</div>
		</form>
		<b class="b4b"></b><b class="b3b"></b><b class="b2b"></b><b class="b1b"></b>
	</div>
</div>
<!--{include(file='foot.html')}-->
<table class="none">
	<tbody id="hidetb">
		<tr align="center">
			<td>{nick}</td>
			<td><input type="text" value="" name="imid[]" class="short-input"/></td>
			<td>昵称</td>
			<td><input type="text" value="" name="imnick[]" class="short-input"/></td>
			<td>
				<a href="javascript:void(0);" onclick="$.oper.del(this);return false;" class="del"></a>
			</td>
			<input type="hidden" value="{imtype}" name="imtype[]"/>
		</tr>
	</tbody>
</table>
<script type="text/javascript">
function jsadd(type) {
	var txt;
	if(type == "qq" || type == "msn") txt = type.toUpperCase();
	else if(type == "ww") txt = "旺旺";
	var html = $("#hidetb").clone().html();
	$("#listtbody").append(html.replace("{nick}",txt).replace("{imtype}",type));
}
</script>
